<h1>Statement Bonus</h1>
<?php
$this->renderPartial('application.modules.member.views.main.info');
?>
<br />
<h2>Report Omset Belanja</h2>
<link type="text/css" href="<?php echo Yii::app()->params['memberUrl']; ?>/addons/freezepanes/freezepanes-style.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo Yii::app()->params['memberUrl']; ?>/addons/freezepanes/freezepanes-js.js"></script>

<br />
<!--<div class="div_freezepanes_wrapper">
    <div class="div_verticalscroll" style="cursor: pointer; ">
        <div style="height:50%;" onmousedown="upp();" onmouseup="upp(1);"><img class="buttonUp" src="<?php echo Yii::app()->baseUrl; ?>/images/icon/box-arrow-up.png" /></div>
        <div style="height:50%;" onmousedown="down();" onmouseup="down(1);"><img class="buttonDn" src="<?php echo Yii::app()->baseUrl; ?>/images/icon/box-arrow-down.png" /></div>
    </div>
    <div class="div_horizontalscroll" style="cursor: pointer; ">
        <div style="float:left; width:50%; height:100%;" onmousedown="right();" onmouseup="right(1);"><img class="buttonRight" src="<?php echo Yii::app()->baseUrl; ?>/images/icon/box-arrow-left.png" /></div>
        <div style="float:right; width:50%; height:100%;" onmousedown="left();" onmouseup="left(1);"><img class="buttonLeft" src="<?php echo Yii::app()->baseUrl; ?>/images/icon/box-arrow-right.png" /></div>
    </div>-->
    <div class="list">
        <table id="data-table" cellpadding="2" style="border:1px solid #999;">
            <tr>
                <th height="25">Periode</th>
                <th>Omset Pribadi</th>
                <th>Omset Group</th>

            </tr>
            <?php
            //echo "<pre>";
            //print_r($data);
            foreach ($data as $id => $row) {
                $sql = "select leadership_level_log_name 
                        from sys_leadership_level_log 
                        where leadership_level_log_periode = '".$row['date']."' 
                        and leadership_level_log_network_id ='".Yii::app()->user->getState('network_id')."' ";
                
                $peringkat = $result = Yii::app()->db->createCommand($sql)->queryScalar();
                $data_group = sizeof($data[$id]['group']);
                $rowspan = "rowspan='$data_group'";
                $i = 1;
                echo '<tr>';
                echo '<td ' . $rowspan . ' nowrap="" align="center" valign="center">' . $row['date'] . '<br>'.$peringkat.'</td>';
                echo '<td ' . $rowspan . ' nowrap="" align="center" valign="center">' . number_format($row['value']) . '</td>';
                if ($data_group < 1) {
                    echo '</tr>';
                }
                foreach ($data[$id]['group'] as $value) {
                    if ($i == 1) {

                        echo '<td  nowrap="" align="left" valign="center"> Kaki ' . $i . ' = ' . number_format($value) . '</td>';
                        echo '</tr>';
                    } else {
                        echo '<tr>';
                        echo '<td align="left" valign="center">Kaki ' . $i . ' = ' . number_format($value) . '</td>';
                        echo '</tr>';
                    }
                    $i++;
                }
            }
            ?>

        </table>
    </div>
<!--</div>-->